﻿using System;
using System.Windows.Media;
using GalaSoft.MvvmLight;
using RPGOnline.Remoting.Entities;
using RPGOnlineWPF.Extensions;

namespace RPGOnlineWPF.ViewModel
{
	public class ChatUserViewModel : ViewModelBase
	{
		private User m_user;

		public string Name { get; private set; }
		public string Character { get; private set; }
		public Brush Color { get; private set; }
		public Guid Id { get { return m_user.Id; } }
		public int TotalHP { get; private set; }
		public int HP { get; private set; }

		public ChatUserViewModel()
		{
		}


		public ChatUserViewModel(User user)
		{
			Update(user);
		}

		public void Update(User user)
		{
			m_user = user;
			Name = m_user.Name;
			Character = m_user.CharacterName;
			Color = new SolidColorBrush(m_user.FontColor.ToWpfColor());
			TotalHP = 47;
			HP = 22;

			RaisePropertyChanged(() => Name);
			RaisePropertyChanged(() => Character);
			RaisePropertyChanged(() => Color);
			RaisePropertyChanged(() => TotalHP);
			RaisePropertyChanged(() => HP);
		}
	}
}